package com.domino.client.view.board;

import com.domino.client.view.BoardGamePanel;
import com.domino.shared.model.Point;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;

public class PointClickHandler 
implements ClickHandler {
	private Point point;
	private BoardGameCallback panel;
	private boolean acceptEvents = false;

	public PointClickHandler(BoardGameCallback panel, Point point) {
		this.panel = panel;
		this.point = point;
	}

	@Override
	public void onClick(ClickEvent event) {
		if (acceptEvents) {
			panel.putBrick(point);
		}
	}



	public void acceptEvents(boolean enabled) {
		acceptEvents = enabled;
	}
}
